package com.gp.test.factory.simple;

import com.gp.test.factory.model.Huawei;
import com.gp.test.factory.model.Iphone;
import com.gp.test.factory.model.Mi;
import com.gp.test.factory.model.Phone;

/**
 * 手机工厂
 *
 * @author
 * @create 2017-05-23 15:12
 */
public class PhoneFactory {
	public static Phone producePhone(String type) {
		if("iphone".equalsIgnoreCase(type)) {
			return new Iphone();
		} else if("huawei".equalsIgnoreCase(type)) {
			return new Huawei();
		} else if("mi".equalsIgnoreCase(type)) {
			return new Mi();
		}
		return null;
	}
}
